home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
PROGRAM
/
CUJ9204.ARJ
/
1004010D
< prev
next >
Wrap
Text File
|
1992-06-02
|
351b
|
17 lines
/* ldiv function */
#include <stdlib.h>
ldiv_t (ldiv)(long numer, long denom)
{ /* compute long quotient and remainder */
ldiv_t val;
val.quot = numer / denom;
val.rem = numer - denom * val.quot;
if (val.quot < 0 && 0 < val.rem)
{ /* fix remainder with wrong sign */
val.quot += 1;
val.rem -= denom;
}
return (val);
}